﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace FDEE.Model
{
    public class CPileRebar : MemberBase
    {
        System.Data.DataRow dr;
        double _h = 0;
        public CPileRebar(string typeName, string pierNumber, System.Data.DataRow _dr)
            : base(typeName, pierNumber)
        {
            dr = _dr;
            _h = double.Parse(dr["墩高（m）"].ToString());
        }
        public override void SetConcreteClass()
        {
            ConcreteClass = eConcreteClass.C35;
        }

        public override void SetConcreteVolume()
        {
            ConcreteVolumn =Math.PI* 0.3*0.3 * _h;
        }

        public override void SetRebarList()
        {
            RebarList = new RebarCollection();
            try
            {
                int h = (int)(double.Parse(dr["墩高（m）"].ToString()) * 1000);
    

                RebarList.Add(new MLABCDRebarRecord(1, 0, "", eDB.DB22, h, 350, 600, 600, 350, 12, eShapeType.MLABCD));
                //int quantity =(int) Math.Round(h / 200.0, 0, MidpointRounding.AwayFromZero);
                int quantity = (int)h / 200 + 1;
                if (quantity <= 2)
                    quantity = 2;
                RebarList.Add(new MCIRebarRecord(2, 0, "", eDB.DB12, 250, 300, quantity, eShapeType.MCI));
            }
            catch (Exception ex)
            {

            }

        }
    }
}
